<div class="layuimini-container">
    <div class="layuimini-main">

        
        <div style="width:400px;float:left">
            <div class="layui-form-item">
                <label class="layui-form-label">抽奖次数</label>
                <div class="layui-input-block">
                    <input type="text" id="luck_draw_frequency" placeholder="请输入抽奖次数" autocomplete="off" value="{$frequency}" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">抽奖说明</label>
                <div class="layui-input-block">
                    <textarea placeholder="请输入抽奖说明" id="luck_draw_explain" class="layui-textarea">{$explain}</textarea>
                </div>
            </div>
        </div>
        <div style="float:left;margin-left:50px;" onclick="submit()">
            <button type="button" class="layui-btn">提交</button>
        </div>
        <div style="clear: both;"></div>
        <table id="currentTable" class="layui-table layui-hide"
               data-auth-add="{:auth('apply.target_cate/add')}"
               data-auth-edit="{:auth('apply.target_cate/edit')}"
               data-auth-delete="{:auth('apply.target_cate/delete')}"
               lay-filter="currentTable">
        </table>
    </div>
</div>

<script>
    function submit() 
    {
        var luck_draw_frequency = $("#luck_draw_frequency").val()
        var luck_draw_explain = $("#luck_draw_explain").val()
        console.log(luck_draw_explain)
        console.log(luck_draw_frequency)

        $.ajax({
            type:"post",
            data:{luck_draw_frequency:luck_draw_frequency,luck_draw_explain:luck_draw_explain},
            url:"config",
            success:function (result) {


                layer.open({
                    type: 1
                    ,id: 'layerDemo' //防止重复弹出
                    ,content: '<div style="padding: 20px 100px;">'+ result.msg +'</div>'
                    ,btn: '确定'
                    ,btnAlign: 'c' //按钮居中
                    ,shade: 0 //不显示遮罩
                    ,yes: function(){
                    layer.closeAll();
                    }
                });
            }
        })

    }
</script>
